<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
    <namespaces>
        <Namespace>
            <prefix>ex</prefix>
            <uri>http://example.com</uri>
        </Namespace>
		<Namespace>
			<prefix>xlink</prefix>
			<uri>http://www.w3.org/1999/xlink</uri>
		</Namespace>
    </namespaces>
    <sourceDataStores>
        <DataStore>
            <id>SRSTestPropertyfile</id>
            <parameters>
                <Parameter>
                    <name>directory</name>
                    <value>file:./</value>
                </Parameter>
            </parameters>
        </DataStore>
    </sourceDataStores>
    <targetTypes>
        <FeatureType>
            <schemaUri>NestedGeometry.xsd</schemaUri>
        </FeatureType>
    </targetTypes>
    <typeMappings>
        <FeatureTypeMapping>
            <sourceDataStore>SRSTestPropertyfile</sourceDataStore>
            <sourceType>SRSTestPropertyfile</sourceType>
            <targetElement>
				ex:geomContainer
			</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>
						ex:geomContainer
					</targetAttribute>
					<idExpression>
                        <OCQL>ID</OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:geom</targetAttribute>
                    <sourceExpression>
                        <OCQL>GEOM</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:nestedFeature[1]</targetAttribute>
                    <sourceExpression>
                        <OCQL>NESTED_GEOM_ID</OCQL>
                        <linkElement>hasGeometry</linkElement>
                        <linkField>FEATURE_LINK</linkField>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:nestedFeature[2]</targetAttribute>
                    <sourceExpression>
                        <OCQL>NESTED_GEOM_ID</OCQL>
                        <linkElement>noGeometry</linkElement>
                        <linkField>FEATURE_LINK</linkField>
                    </sourceExpression>
                </AttributeMapping>
				<AttributeMapping>
                    <targetAttribute>ex:nestedFeature[3]</targetAttribute>
                    <sourceExpression>
                        <OCQL>NESTED_GEOM_ID</OCQL>
                        <linkElement>noGeometry</linkElement>
                        <linkField>FEATURE_LINK</linkField>
                    </sourceExpression>					
					<ClientProperty>
						<name>xlink:href</name>
						<value>strConCat('http://example.com/UrnResolver/?uri=', NESTED_GEOM_ID)</value>
					</ClientProperty>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>hasGeometry</mappingName>
            <sourceDataStore>SRSTestPropertyfile</sourceDataStore>
            <sourceType>SRSTestPropertyfile</sourceType>
            <targetElement>
				ex:nestedGeom
			</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>
						ex:nestedGeom
					</targetAttribute>
                    <idExpression>
                        <OCQL>strConcat('nested.', ID)</OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:geom</targetAttribute>
                    <sourceExpression>
                        <OCQL>GEOM</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
		                FEATURE_LINK
		            </targetAttribute>
                    <sourceExpression>
                        <OCQL>ID</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>noGeometry</mappingName>
            <sourceDataStore>SRSTestPropertyfile</sourceDataStore>
            <sourceType>SRSTestPropertyfile</sourceType>
            <targetElement>
				ex:nestedGeom
			</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>
						ex:nestedGeom
					</targetAttribute>
                    <idExpression>
                        <OCQL>strConcat('secondNested.', ID)</OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:name</targetAttribute>
                    <sourceExpression>
                        <OCQL>'NAME'</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:nestedFeature</targetAttribute>
                    <sourceExpression>
                        <OCQL>NESTED_GEOM_ID</OCQL>
                        <linkElement>hasGeometry2</linkElement>
                        <linkField>FEATURE_LINK</linkField>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
		                FEATURE_LINK
		            </targetAttribute>
                    <sourceExpression>
                        <OCQL>ID</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <mappingName>hasGeometry2</mappingName>
            <sourceDataStore>SRSTestPropertyfile</sourceDataStore>
            <sourceType>SRSTestPropertyfile</sourceType>
            <targetElement>
				ex:nestedGeom
			</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>
						ex:nestedGeom
					</targetAttribute>
                    <idExpression>
                        <OCQL>strConcat('thirdNested.', ID)</OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>ex:geom</targetAttribute>
                    <sourceExpression>
                        <OCQL>GEOM</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
		                FEATURE_LINK
		            </targetAttribute>
                    <sourceExpression>
                        <OCQL>ID</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
    </typeMappings>
</as:AppSchemaDataAccess>